﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckInQtyEntry.aspx.cs" Inherits="com.vs.RF.Web.receiving.CheckInQtyEntry" MasterPageFile="~/RF.Master" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="com.vs.DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server">

    <script type="text/javascript">
        function valForm() {
            if (isNaN(form1.tbQty.value)) {
                alert("请输入数字");
                return false;
            }

            var iBaseQty = form1.tbQty.value * form1.cmbUM.value;
            if (iBaseQty <= 0) {
                alert("请输入有效数字");
                return false;
            }
            form1.hdBaseQty.value = iBaseQty;
            return true;
        }
        var iNumOfSubmit = 0;

        function btnOK_Click() {
            if (iNumOfSubmit > 0)
                return;
            if (valForm()) {
                iNumOfSubmit++;
                form1.action = "CheckInQtyEntryHandling.aspx";
                form1.submit();
            }
        }

        function btnCancel_Click() {
            form1.action = "ItemEntry.aspx";
            form1.submit();
        }

        function on_Load() {
            form1.tbQty.focus();
        }
    </script>
    
    <%=stErrorMessage %>
    <form id="form1" action="CheckInQtyEntryHandling.aspx" method="post">
    <div>
        <table>
            <tr>
                <td>货号：</td>
                <td><%=this.itmDO.ITEM %></td>
            </tr>
            <tr>
                <td>名称：</td>
                <td><%=this.itmDO.ITEM_DESC %></td>
            </tr>
            <tr>
                <td>数量：</td>
                <td>
                    <input type="text" name="tbQty"/>
                </td>
            </tr>
            <tr>
                <td>单位：</td>
                <td>
                    <select name="cmbUM">
                    <% 
                        int iValue;
                        string stText;
                        foreach (DataRow drUM in dtUM.Rows)
                        {
                            iValue = DataManager.GetInt(drUM, "CONVERSION_QTY");
                            stText = DataManager.GetString(drUM, "QUANTITY_UM") + "(" + iValue + ")";
                    %>
                        <option value="<%= iValue %>"><%= stText %></option>
                    <%
                        }
                    %>
                    </select>
                </td>
            </tr>
        </table>
        <input type="hidden" name="hdBaseQty" />
    </div>    
    <div id="footer">  
        <input type="button" id="Button1" value="确定" onclick="btnOK_Click()" class="greyRed"/>
        <input type="button" id="Button2" value="取消" onclick="btnCancel_Click()" class="greyRed" />
    </div>
    </form>
</asp:Content>